<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script src="./data.js"></script>
    <script>
        for(var j=0;j<clothes.length-1;j++){
            var min = j;
            for(var i=j+1;i<clothes.length;i++){
                if(clothes[i]['sales']<clothes[min]['sales']){
                    min = i;
                }
            }

            var temp = clothes[j];
            clothes[j] = clothes[min];
            clothes[min] = temp;

        }

        console.log(clothes);
    </script>
</body>
</html>